package com.ag.bean;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * TbRolePermissionId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Embeddable
public class TbRolePermissionId implements java.io.Serializable {

	// Fields

	private String RId;
	private String PId;

	// Constructors

	/** default constructor */
	public TbRolePermissionId() {
	}

	/** full constructor */
	public TbRolePermissionId(String RId, String PId) {
		this.RId = RId;
		this.PId = PId;
	}

	// Property accessors

	@Column(name = "R_ID", nullable = false, length = 4)
	public String getRId() {
		return this.RId;
	}

	public void setRId(String RId) {
		this.RId = RId;
	}

	@Column(name = "P_ID", nullable = false, length = 4)
	public String getPId() {
		return this.PId;
	}

	public void setPId(String PId) {
		this.PId = PId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TbRolePermissionId))
			return false;
		TbRolePermissionId castOther = (TbRolePermissionId) other;

		return ((this.getRId() == castOther.getRId()) || (this.getRId() != null
				&& castOther.getRId() != null && this.getRId().equals(
				castOther.getRId())))
				&& ((this.getPId() == castOther.getPId()) || (this.getPId() != null
						&& castOther.getPId() != null && this.getPId().equals(
						castOther.getPId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getRId() == null ? 0 : this.getRId().hashCode());
		result = 37 * result
				+ (getPId() == null ? 0 : this.getPId().hashCode());
		return result;
	}

}